netfilter
firewalld
Predefined Zones
Predefined Services
Firewall Configuration Methods
firewall-config
firewall-cmd
netfilterLinux kernel includes netfilter subsystem
Allows kernel modules to inspect incoming, outgoing and forwarded packets
Can modify, drop, or reject packets in programmatic way before reaching user space components
Main building block for firewall on Red Hat Enterprise Linux 7
Other programs interact with netfilter, such as:
iptables
ip6tables for IPv6
ebtables for software bridges
firewalldNew method of interacting with netfilter
System daemon can configure and monitor system firewall rules
Applications can request ports to be opened using DBus messaging system
Feature can be disabled or locked down
Covers IPv4, IPv6, and potentially ebtables settings
Install package part of basic install
Not part of minimal install
Classifies and diverts network traffic into zones
Zones have own firewall rules
Zones have own list of ports and services to be opened or closed
Can use NetworkManager for machines that regularly change networks
Customize zone rules for each connection
firewalldfirewalld checks source address of every incoming packet
If source address is tied to specific zone, zone’s rules are parsed
If source address is not tied to zone, uses zone for incoming network interface
If network interface is not tied to a zone, uses default zone
Default zone is not separate zone
It is another zone specified as default
public zone is used by default
System admin can change default zone
Most zones permit traffic which matches specific ports/protocols ("631/udp") or predefined services ("ssh")
Non-matching traffic is rejected
Trusted zone is one exception
Permits all traffic by default
Zone name | Default configuration |
| Allow all incoming traffic. |
| Reject incoming traffic unless related to outgoing traffic or matching the ssh, mdns, ipp-client, samba-client, or dhcpv6-client predefined services. |
| Reject incoming traffic unless related to outgoing traffic or matching the ssh, mdns, ipp-client, samba-client, or dhcpv6-client predefined services (same as the home zone to start with). |
| Reject incoming traffic unless related to outgoing traffic or matching the ssh, ipp-client, or dhcpv6-client predefined services. |
| Reject incoming traffic unless related to outgoing traffic or matching the ssh or dhcpv6-client predefined services. The default zone for newly-added network interfaces. |
| Reject incoming traffic unless related to outgoing traffic or matching the ssh predefined service. Outgoing IPv4 traffic forwarded through this zone is masqueraded to look like it originated from the IPv4 address of the outgoing network interface. |
| Reject incoming traffic unless related to outgoing traffic or matching the ssh predefined service. |
| Reject all incoming traffic unless related to outgoing traffic. |
| Drop all incoming traffic unless related to outgoing traffic. Do not even respond with ICMP errors. |
firewalld.zones(5) man page
Service name | Configuration |
| Local SSH server. Traffic to 22/tcp. |
| Local DHCPv6 client. Traffic to 546/udp on the fe80::/64 IPv6 network. |
| Local IPP printing. Traffic to 631/udp. |
| Local Windows file and print sharing client. Traffic to 137/udp and 138/udp. |
| Multicast DNS (mDNS) local-link name resolution. Traffic to 5353/udp to the 224.0.0.251 (IPv4) or ff02::fb (IPv6) multicast addresses. |
|
Directly edit configuration files in /etc/firewalld/
Use graphical firewall-config tool
Use firewall-cmd from command line
firewall-configGraphical tool for altering and inspecting firewalld configuration
Supports running, in-memory configuration
Supports persistent, on-disk configuration
Install firewall-config tool from firewall-config package
Launch in two ways:
From command line as firewall-config
From Applications menu under Applications → Sundry → Firewall
Prompts unprivileged users for root password to continue
firewall-configfirewall-cmdCommand-line client to interact with firewalld
Install with main firewalld package
Can perform same actions as firewall-config
firewall-cmdfirewall-cmd commands | Explanation |
| Query the current default zone. |
| Set the default zone. This changes both the runtime and the permanent configuration. |
| List all available zones. |
| List all zones currently in use (have an interface or source tied to them), along with their interface and source information. |
| Route all traffic coming from the IP address or network/netmask <CIDR> to the specified zone. If no --zone= option is provided, the default zone will be used. |
| Remove the rule routing all traffic coming from the IP address or network/netmask <CIDR> from the specified zone. If no --zone= option is provided, the default zone will be used. |
| Route all traffic coming from <INTERFACE> to the specified zone. If no --zone= option is provided, the default zone will be used. |
| Associate the interface with <ZONE> instead of its current zone. If no --zone= option is provided, the default zone will be used. |
| List all configured interfaces, sources, services, and ports for <ZONE>. If no --zone= option is provided, the default zone will be used. |
| Retrieve all information for all zones. (Interfaces, sources, ports, services, etc.) |
| Allow traffic to <SERVICE>. If no --zone= option is provided, the default zone will be used. |
| Allow traffic to the <PORT/PROTOCOL> port(s). If no --zone= option is provided, the default zone will be used. |
| Remove <SERVICE> from the allowed list for the zone. If no --zone= option is provided, the default zone will be used. |
| Remove the <PORT/PROTOCOL> port(s) from the allowed list for the zone. If no --zone= option is provided, the default zone will be used. |
| Drop the runtime configuration and apply the persistent configuration. |
firewall-cmd[root@server1 ~]# firewall-cmd --set-default-zone=dmz [root@server1 ~]# firewall-cmd --permanent --zone=internal --add-source=192.168.0.0/24 [root@server1 ~]# firewall-cmd --permanent --zone=internal --add-service=mysql [root@server1 ~]# firewall-cmd --reload
Man pages: firewall-cmd(1), firewall-config(1), firewalld(1), firewalld.zone(5) and firewalld.zones(5)
netfilter
firewalld
Predefined Zones
Predefined Services
Firewall Configuration Methods
firewall-config
firewall-cmd
Nice job!
Click the button below to complete this module of the course:
Click the button below to continue to the course homepage:
Please continue with the next item in the course.